package com.shimao.celnet.payment.report.excel;

import org.springframework.util.ResourceUtils;

import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.FileNotFoundException;

/**
 * 获取模板文件的工具类
 * Created by ensure.xu on 2017/12/25.
 */
public class TemplateFileUtil {
    public InputStream getTemplates(String tempName) throws FileNotFoundException {
        //所有的Excel模板文件都放在resources/static/excel/目录下new InputStreamReader(getClass().getResourceAsStream("static/excel/"+tempName), "UTF-8")
		InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream("/static/excel/"+tempName);
		System.out.println("****************" + inputStream);
        return inputStream;
    }
}
